/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;

import java.text.NumberFormat;
import java.util.Locale;

/**
 * <p>Project: JavaStudy - Formatnumber
 * <p>Powered by jiangbo On 2023-01-31
 * 21:49:42
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Formatnumber {
    public static void main(String[] args) {
        int a = 1424248;
        float b = .5F;
        int c = 3;
        System.out.printf("%03d %d %.3f%n", c, a, b);
//格式化货币
        NumberFormat nf1 = NumberFormat.getCurrencyInstance();
        nf1.setMinimumFractionDigits(5);

        System.out.println(nf1.format(a));
        NumberFormat nf2 = NumberFormat.getCurrencyInstance(Locale.US);
        System.out.println(nf2.format(a));
    }

}


